﻿<%@ Page Title="" Language="C#" MasterPageFile="~/WindowMaster.master" AutoEventWireup="true" CodeFile="ModalWindow.aspx.cs" Inherits="ModalWindow" %>

<asp:Content ID="Content" ContentPlaceHolderID="ContentPlaceHolder" runat="Server">
    <telerik:RadAjaxPanel runat="server" ID="AjaxPanel" OnAjaxRequest="AjaxPanel_AjaxRequest" LoadingPanelID="RadAjaxLoadingPanel">
        <table>
            <tr>
                <td>
                    <asp:Label runat="server" ID="LblTime"></asp:Label></td>
            </tr>
            <tr>
                <td>
                    <telerik:RadNumericTextBox runat="server" ID="newMoney"></telerik:RadNumericTextBox></td>
            </tr>
            <tr>
                <td>
                    <telerik:RadButton ID="RadButton" runat="server" Text="Postback" OnClick="RadButton_Click"></telerik:RadButton>
                </td>
            </tr>
        </table>
    </telerik:RadAjaxPanel>
    <telerik:RadCodeBlock ID="RadCodeBlock" runat="server">
        <script type="text/javascript">
            function submitChanges(newMoney) {
                var data = parent.$("body").data("<%=GUID %>");
                data.data.someMoney = parseFloat(newMoney.replace(',', '.'));
                data.callbackMethod(data.data);
            }
            function pageLoad() {
                var data = parent.$("body").data("<%=GUID %>");
                if (!data.loaded) {
                    $find("<%=AjaxPanel.ClientID%>").ajaxRequest(JSON.stringify(data));
                    data.loaded = true;
                }
            }
        </script>
    </telerik:RadCodeBlock>
</asp:Content>
